package org.codegallery.javagal.thread;

public class MessagePrinter implements Runnable {
	private final String message;
	private final long interval;

	public MessagePrinter(String message, long interval) {
		super();
		this.message = message;
		this.interval = interval;
	}

	public void run() {
		try {
			while (true) {
				System.out.println(message);
				Thread.sleep(interval);
			}
		} catch (InterruptedException iex) {
		}

	}

}
